/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.sys.web;

import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.sys.service.UpdateService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 升级sql Controller
 * @author ThinkGem
 * @version 2013-6-2
 */
@Controller
@RequestMapping(value = "${adminPath}/sys/update")
public class UpdateController extends BaseController {

	@Autowired
	private UpdateService updateService;

	@RequiresPermissions("sys:sql:update")
	@RequestMapping("page")
	public String update(){
		return "modules/sys/update";
	}

	@RequiresPermissions("sys:sql:update")
	@RequestMapping("update110")
	@ResponseBody
	public String update110(){
		updateService.updateTable110();
		return "更新完成:版本 v1.1.0";
	}

	@RequiresPermissions("sys:sql:update")
	@RequestMapping("update113")
	@ResponseBody
	public String update113(){
		updateService.updateTable113();
		return "更新完成:版本 v1.1.3";
	}

	@RequiresPermissions("sys:sql:update")
	@RequestMapping("update114")
	@ResponseBody
	public String updateTable114(){
		updateService.updateTable114();
		return "更新完成:版本 v1.1.3";
	}

	@RequiresPermissions("sys:sql:update")
	@RequestMapping("update115")
	@ResponseBody
	public String updateTable115(){
		updateService.updateTable115();
		return "更新完成:版本 v1.1.5";
	}

	@RequiresPermissions("sys:sql:update")
	@RequestMapping("update116")
	@ResponseBody
	public String updateTable116(){
		updateService.updateTable116();
		return "更新完成:版本 v1.1.6";
	}

	@RequiresPermissions("sys:sql:update")
	@RequestMapping("insertSelfProperties")
	@ResponseBody
	public String insertSelfProperties(){
		updateService.insertSelfProperties();
		return "更新完成:自助借阅参数!";
	}

	@RequiresPermissions("sys:sql:update")
	@RequestMapping("printTemplateAddLineSize")
	@ResponseBody
	public String printTemplateAddLineSize(){
		updateService.printTemplateAddLineSize();
		return "更新完成:打印参数!";
	}
}
